import { TBattleFieldBuffer } from "../../../Message/Db/Tables/TBattleFieldBuffer";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class BattleFieldBufferConfig
    
    export  class BattleFieldBufferConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (BattleFieldBufferConfig._instance != null) 
            {
                throw new Error(" BossConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TBattleFieldBuffer();
                loc1.type = loc2.type;
                loc1.killTime = loc2.killTime;
                loc1.roleLevel = loc2.roleLevel;
                loc1.buffId = loc2.buffId;
                this._map[loc1.type + "_" + loc1.buffId] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_battle_field_buffer.json");
            this.write(loc1);
            return;
        }

        public isBufferByType(arg1: int, arg2: int): Boolean
        {
            return !(this._map[arg1 + "_" + arg2] == null);
        }

        public static get instance(): BattleFieldBufferConfig
        {
            if (BattleFieldBufferConfig._instance == null) 
            {
                BattleFieldBufferConfig._instance = new BattleFieldBufferConfig();
            }
            return BattleFieldBufferConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: BattleFieldBufferConfig;
    }
